﻿@using QuocHoi_TV_Frontend.Models
@{Category objCate = ViewBag.objCate;
  News Newsest = null;
  string strlinkNewsest = "";
  try
  {
      Newsest = ViewBag.lstcatenews[0];
  }
  catch{ }
}
  @if(Newsest != null){
        strlinkNewsest = Url.RouteUrl("NewsDetail",
                      new
                      {
                          controller = "News",
                          action = "NewsDetailHome",
                          cate_name = Util.RemoveSign4VietnameseString(Newsest.Category.CateName),
                          year = DateTime.Parse(Newsest.CreateDate.ToString()).Year,
                          month = DateTime.Parse(Newsest.CreateDate.ToString()).Month,
                          news_title = Util.RemoveSign4VietnameseString(Newsest.NewsTitle),
                          newsID = Newsest.NewsID
                      }
                       );
        <div class="right_boxcm">
                <div class="day_ifon">@Html.Raw(UtilDate.FormatDateVN(DateTime.Parse(Newsest.CreateDate.ToString())))</div>
                <div class="tile_newsbig">
                    <a href="@Html.Raw(strlinkNewsest)">@Html.Raw(NewsHelper.Sliptsubject(Newsest.NewsTitle, 40))</a>
                </div>
                <div class="excerpts_newsbig">@Html.Raw(NewsHelper.Sliptsubject(Newsest.NewSub, 160))</div>
                @{   List<News> lstnewsEvent = DataModels.GetListNewsInEventsHadNewsID(Newsest.NewsID, 5);}
                <div class="ndlq">
                    Nội dung liên quan
								
                </div>
                 @if (lstnewsEvent.Count > 0)
                    {
                        <div class="all_ndlq">
                            <ul>
                   
                                @foreach (News itemNewevent in lstnewsEvent)
                                {
                                    string strlinkNewevent = Url.RouteUrl("NewsDetail",
                                    new
                                    {
                                        controller = "News",
                                        action = "NewsDetailHome",
                                        cate_name = Util.RemoveSign4VietnameseString(itemNewevent.Category.CateName),
                                        year = DateTime.Parse(itemNewevent.CreateDate.ToString()).Year,
                                        month = DateTime.Parse(itemNewevent.CreateDate.ToString()).Month,
                                        news_title = Util.RemoveSign4VietnameseString(itemNewevent.NewsTitle),
                                        newsID = itemNewevent.NewsID
                                    }
                                        );
                                    <li>
                                        <a href="@Html.Raw(strlinkNewevent)">@Html.Raw(NewsHelper.Sliptsubject(itemNewevent.NewsTitle, 40))</a>
                                    </li>
                                }
                                </ul>
                        </div>
                     string strlinkNeweventlast = Url.RouteUrl("NewsDetail",
                                                        new
                                                        {
                                                            controller = "News",
                                                            action = "NewsDetailHome",
                                                            cate_name = Util.RemoveSign4VietnameseString(lstnewsEvent[lstnewsEvent.Count - 1].Category.CateName),
                                                            year = DateTime.Parse(lstnewsEvent[lstnewsEvent.Count - 1].CreateDate.ToString()).Year,
                                                            month = DateTime.Parse(lstnewsEvent[lstnewsEvent.Count - 1].CreateDate.ToString()).Month,
                                                            news_title = Util.RemoveSign4VietnameseString(lstnewsEvent[lstnewsEvent.Count - 1].NewsTitle),
                                                            newsID = lstnewsEvent[lstnewsEvent.Count - 1].NewsID
                                                        }
                                                         );
                                                     
                    <div class="more_ttnewsbig">
                        <div class="img_more_ttnb">
                            <a href="@Html.Raw(strlinkNeweventlast)">
                                <img width="220" height="140" src="@lstnewsEvent[lstnewsEvent.Count - 1].PathImgSmall">
                            </a>
                        </div>
                        <div class="tile_more_ttnb">
                            <a href="@Html.Raw(strlinkNeweventlast)">@Html.Raw(NewsHelper.Sliptsubject(lstnewsEvent[lstnewsEvent.Count - 1].NewsTitle, 20))</a>
                        </div>
                        <p>@Html.Raw(NewsHelper.Sliptsubject(lstnewsEvent[lstnewsEvent.Count - 1].NewSub, 80))</p>
                    </div> 
                    } 
            </div>
  }
  